﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucQuestion.ascx.cs" Inherits="ucQuestion" %>
<table>
    <tr>
        <td>
            Enter Question Text
        </td>
        <td>
            <asp:TextBox ID="txtQuestionText" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Select Catergory
        </td>
        <td>
            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            Sub Category
        </td>
        <td>
            <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            Image
        </td>
        <td>
            <asp:FileUpload ID="FileUpload1" runat="server" />
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;
        </td>
        <td>
            <asp:Button ID="btnAddQuestion" runat="server" OnClick="btnAddQuestion_Click" Text="Add Question" />
        </td>
    </tr>
    <tr>
        <td colspan="2" align="left">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
                BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="QUESTION_ID"
                ForeColor="Black" GridLines="Horizontal" ShowHeader="False" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                OnRowCommand="GridView1_RowCommand" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing"
                OnRowUpdating="GridView1_RowUpdating" Width="800px">
                <Columns>
                    <asp:TemplateField ItemStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("ROW")%>'></asp:Label>. &nbsp;
                        </ItemTemplate>
                        <ItemStyle VerticalAlign="Top"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("QUESTION_TEXT") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("QUESTION_TEXT") %>'></asp:Label>
                            <asp:Panel ID="Panel1" runat="server" Visible="False">
                                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                <asp:CheckBox ID="CheckBox1" runat="server" Text="Correct Answer" />
                                <asp:LinkButton ID="LinkButton4" CommandName="AnswerSave" runat="server">Save</asp:LinkButton>
                                <asp:LinkButton ID="LinkButton5" runat="server" CommandName="AnswerCancel">Cancel</asp:LinkButton>
                                <asp:HiddenField ID="HiddenField1" runat="server" />
                            </asp:Panel>
                            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" CellPadding="5" DataKeyNames="ANSWE_ID"
                                ForeColor="#333333" GridLines="None" ShowHeader="False" Width="300px" 
                                CellSpacing="5" onrowcancelingedit="GridView2_RowCancelingEdit" 
                                onrowdeleting="GridView2_RowDeleting" onrowediting="GridView2_RowEditing" 
                                onrowupdating="GridView2_RowUpdating">
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50%">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ANSWER_TEXT") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("CHARCTER") %>'></asp:Label>.&nbsp;
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("ANSWER_TEXT") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Left" Width="50%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%">
                                        <EditItemTemplate>
                                            <asp:RadioButton ID="RadioButton1" GroupName="a" runat="server" Checked='<%# Bind("IS_CORRECT") %>' />
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:RadioButton ID="RadioButton2" GroupName="b" runat="server" Checked='<%# Bind("IS_CORRECT") %>'
                                                Enabled="False" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" Width="15%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField ShowHeader="False" ItemStyle-Width="35%">
                                        <EditItemTemplate>
                                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                                Text="Update"></asp:LinkButton>
                                            &nbsp;|&nbsp;
                                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                                Text="Cancel"></asp:LinkButton>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Edit"
                                                Text="Edit"></asp:LinkButton>&nbsp;|&nbsp;
                                            <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandName="Delete"
                                                Text="Delete"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                </Columns>
                                <EditRowStyle BackColor="#7C6F57" />
                                <FooterStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True" />
                                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#E3EAEB" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#F8FAFA" />
                                <SortedAscendingHeaderStyle BackColor="#246B61" />
                                <SortedDescendingCellStyle BackColor="#D4DFE1" />
                                <SortedDescendingHeaderStyle BackColor="#15524A" />
                            </asp:GridView>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Right">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="Update"></asp:LinkButton>&nbsp;|&nbsp;
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="Cancel"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" CommandArgument='<%# Eval("QUESTION_ID") %>'
                                CommandName="AddAnswer" Text="Add Answer"></asp:LinkButton>&nbsp;|&nbsp;
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="Edit"></asp:LinkButton>&nbsp;|&nbsp;
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                Text="Delete"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Right" VerticalAlign="Top"></ItemStyle>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F7F7F7" />
                <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                <SortedDescendingCellStyle BackColor="#E5E5E5" />
                <SortedDescendingHeaderStyle BackColor="#242121" />
            </asp:GridView>
        </td>
    </tr>
</table>
